import {DateObjectWithOptionalDay} from '../types';

export function generateMonthItems(date: number, pastRange: number, futureRange: number) {
  const currentYear = new Date(date).getFullYear();
  const monthItems: DateObjectWithOptionalDay[] = [];
  for (let year = currentYear - pastRange; year <= currentYear + futureRange; year++) {
    for (let month = 0; month < 12; month++) {
      monthItems.push({timestamp: date, year, month});
    }
  }
  return monthItems;
}
